package com.whu.helpluojia.service;

import com.whu.helpluojia.domain.Bagman;
import com.whu.helpluojia.domain.MyPublish;
import com.whu.helpluojia.domain.Supply;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Date;
import java.util.List;

/**
* @author 92948
* @description 针对表【supply】的数据库操作Service
*/
public interface SupplyService extends IService<Supply> {

    /**
     * 增加供需帖子
     * @param supply
     * @return
     */
    public int addSupply(Supply supply);

    /**
     * 根据id删除供需帖子
     * @param id
     * @return
     */
    public int deleteSupply(Long id);

    /**
     * 根据id修改供需帖子
     * @param supply
     * @return
     */
    public int updateSupply(Supply supply);

    /**
     * 根据id查询供需帖子
     * @param id
     * @return
     */
    public Supply querySupplyById(Long id);

    /**
     * 查询所有供需帖子
     * @return
     */
    public List<Supply> querySupplyList();

    /**
     * 根据供需帖子的发布时间查询供需帖子
     * @param dateTime
     * @return
     */
    public List<Supply> querySupplyByDate(Date dateTime);

    /**
     * 根据发帖人的用户id查询供需帖子
     * @param userId
     * @return
     */
    public Supply querySupplyByUser(Long userId);

    /**
     * 根据所选供需的种类查询供需帖子
     * @param category
     * @return
     */
    public List<Supply> querySupplyByCategory(String category);

    /**
     * 根据描述片段查询供需帖子
     * @param description
     * @return
     */
    public List<Supply> querySupplyByDescription(String description);


    /*public List<Supply> querySupplyByDestination(Supply supply, double maxLat, double maxLon, double minLat, double minLon);*/

    public List<MyPublish> getMyDetail(Long userId);

    public Supply[] selectAll();

    void solute(Long id);

    public MyPublish getSupplyDetail(Long id,Long userId);
}
